-
Notifications
You must be signed in to change notification settings - Fork 409
Add quarto install chrome-headless-shell command
#14030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cderv
wants to merge
12
commits into
main
Choose a base branch
from
chrome-headless-improvement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,066
−59
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Shared infrastructure for downloading binaries from the Google Chrome for Testing (CfT) API. Provides platform detection, API fetching, binary search, and download+extract functions that will be used by installable tool implementations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement quarto install/uninstall lifecycle for chrome-headless-shell
using Chrome for Testing (CfT) infrastructure. Stores binaries under
quartoDataDir("chrome-headless-shell") with a plain text version file
matching the tinytex/verapdf pattern.
Key exports for downstream tasks:
- chromeHeadlessShellInstallable: InstallableTool registration
- chromeHeadlessShellExecutablePath(): browser discovery
- chromeHeadlessShellInstallDir(): install location
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… quarto check - Register chrome-headless-shell in kInstallableTools, enabling `quarto install/uninstall chrome-headless-shell` - Fix installableTools() to return registry keys instead of lowercased display names (broken for multi-word tool names) - Add WSL handling: allow chrome-headless-shell install with info note (unlike full chromium which blocks on WSL) - Insert chrome-headless-shell as priority 2 in getBrowserExecutablePath() between system Chrome and legacy puppeteer revisions - Update error message to recommend chrome-headless-shell over chromium - Add chrome-headless-shell detection in `quarto check install` - Fix pre-existing bug: chromium lookup in quarto check used display name comparison that never matched due to casing; now uses registry key lookup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The chromium fallback branch in chromeCb() accessed binDir and installedVersion as properties but they are async functions on the InstallableTool interface. This was pre-existing dead code (the name comparison never matched), but now reachable after the registry key lookup fix. Properly await both methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add if (chromiumVersion) guard before displaying version, consistent with the chrome-headless-shell branch. Prevents showing literal "undefined" if the version file is missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add smoke tests exercising mermaid and graphviz rendering through chrome-headless-shell (PDF, Typst, multi-diagram). Remove not_os:linux restrictions from existing mermaid SVG tests since Chrome is now available on all CI platforms. Replace browser-actions/setup-chrome with quarto install chrome-headless-shell in CI workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check intermediate .tex/.typ files for \includegraphics and image() references to mermaid-figure and dot-figure PNGs. This proves Chrome actually produced screenshot images rather than only checking the render didn't error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Env var - chrome-headless-shell - system - chromium
This should also close mermaid issues on CI
Extract browser detection logic into `detectChromeForCheck()` helper, replacing the 4-branch if/else chain with a data object and single formatting block. Fixes redundant `safeExistsSync` call and normalizes JSON key from `QUARTO_CHROMIUM_invalid` to `warning`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19fe5d7 to
aa4b99d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
New
quarto install chrome-headless-shellcommand that downloads Chrome Headless Shell from Google's Chrome for Testing API. This is a smaller, lighter headless browser purpose-built for automation — ideal for diagram rendering (Mermaid, Graphviz) to non-HTML formats.Part of the Chrome Headless improvements epic (#11877).
What's included
InstallableToolimplementation registered in the tool system (quarto install,quarto uninstall,quarto update,quarto tools)getBrowserExecutablePath():QUARTO_CHROMIUMenv varquarto checkintegration showing chrome-headless-shell installation statusQUARTO_CHROMIUMvalidation — gracefully falls through when the path doesn't existsetup-chromein CI)setup-chromeaction withquarto install chrome-headless-shellchrome-for-testing.tsandchrome-headless-shell.tsDesign rationale
Chrome Headless Shell is Google's recommended replacement for the
--headlessflag on full Chrome. It ships no UI, has fewer system dependencies, and is distributed through the stable Chrome for Testing API — making it more reliable than the legacyquarto install chromiumapproach which relied on Puppeteer's bundled Chromium revisions.The priority chain preserves backward compatibility: users with
QUARTO_CHROMIUMset or a system Chrome installed see no behavior change. The new tool slots in as a middle ground — lighter than system Chrome, more reliable than legacy chromium.Test plan
quarto checkdisplays chrome-headless-shell statusquarto install chrome-headless-shellinstead ofsetup-chromePart of #11877
Closes #10961, closes #6821, closes #13704